﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace YunBox2.Client.Infrastructure
{
	/// <summary>
	/// UserPasswordChangeView.xaml 的交互逻辑
	/// </summary>
	public partial class MyPasswordEditorView : UserControl
	{
		public MyPasswordEditorView()
		{
			this.InitializeComponent();
		}



        private void OldPasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
        {
            var vm = DataContext as ViewModels.MyPasswordEditorViewModel;
            if(vm!=null)
            {
                vm.OldPassword = ((PasswordBox) sender).Password;
            }
        }

        private void NewPasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
        {
            var vm = DataContext as ViewModels.MyPasswordEditorViewModel;
            if (vm != null)
            {
                vm.NewPassword = ((PasswordBox)sender).Password;
            }
        }

        private void ConfrimPasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
        {
            var vm = DataContext as ViewModels.MyPasswordEditorViewModel;
            if (vm != null)
            {
                vm.ConfrimPassword = ((PasswordBox)sender).Password;
            }
        }
	}
}